package com.rd.student.jike.class2.lihongming.Slolution3;

/**
 * @Auther:Heinrich
 * @Date:2023/7/19-07-19-14:40
 * @Description:com.rd.student.jike.class2.lihongming.Solution719
 * @version:1.0
 */
public class Question1 {
    public static void main(String[] args) throws InterruptedException {
        for (int i = 0; i < 99; i++) {
            printChar();
        }
    }
    public static void printChar()throws InterruptedException{
        ThreadCharPrint threadCharPrint1 = new ThreadCharPrint("charThread1", 'A');
        ThreadCharPrint threadCharPrint2 = new ThreadCharPrint("charThread2", 'B');
        ThreadCharPrint threadCharPrint3 = new ThreadCharPrint("charThread3", 'C');
        threadCharPrint1.start();
        threadCharPrint1.join();
        //Thread.sleep(1);
        threadCharPrint2.start();
        //Thread.sleep(1);
        threadCharPrint2.join();
        threadCharPrint3.start();
        threadCharPrint3.join();
    }
}
class ThreadCharPrint extends Thread{
    char result;

    public ThreadCharPrint(String name, char result) {
        super(name);
        this.result = result;
    }

    @Override
    public void run() {
        System.out.print(result);
    }
}
//class ThreadAlphabetPrint implements Runnable{
//
//    @Override
//    public void run() {
//        for (int i = 0; i < 26; i++) {
//            System.out.print((char)(97+i));
//            try {
//                Thread.sleep(200);
//            } catch (InterruptedException e) {
//                throw new RuntimeException(e);
//            }
//        }
//    }
//}